package a12;

import static org.junit.Assert.*;

import java.io.FileNotFoundException;
import java.io.FileReader;

import org.junit.Test;

public class WordIndexTest {

	@Test
	public void test() {
		try {
			FileReader fileReader = new FileReader(
					"//Users//Meg//Downloads//10kwords.txt");
			WordIndex idx = new WordIndex(fileReader);
			assertEquals(WordIndex.lookup("eys"), "yes");
			assertEquals(WordIndex.lookup("act"), "act,cat");
			assertEquals(WordIndex.lookup("ungher"), "hunger");
			assertEquals(WordIndex.lookup("irefdn"), "friend,finder");
			if (WordIndex.lookup("a;oidsghw") != null)
				fail("Well that didn't work.");
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
	}
	
}
